app_family.controller("controller_oldersel", function($scope, $rootScope, httpRequest, $location) {
	$rootScope.$broadcast('currentModule', 'controller_oldersel');
	$rootScope.$broadcast('footerFlag', false); // 是否显示底部导航
	
	$scope.imagebasepath = imagebasepath;
	
	/**
	 * 判断是否用手机登录过
	 */
	if (sessionStorage.getItem('data_sessionStorage')) {
		var familyPhone = JSON.parse(sessionStorage.getItem('data_sessionStorage')).familyInfo.phone;
		if (familyPhone == '' || familyPhone == null) {
			window.location.replace(basepath + 'login.html');
			return;
		}
	} else {
		window.location.replace(basepath + 'login.html');
		return;
	}
	
	/**
	 * 获取列表 若未绑定，跳往绑定页面
	 */
	httpRequest.getAllOlder({
		mobile : familyPhone
	}, function (data) {
		if (data.success === true) {
			$scope.familyList = data.obj;
		} else if (data.success === false) {
			$.dialog.showToast({msgTxt : data.msg});
		}
	});
	
	/**
	 * 点击 去评估
	 */
	$scope.toAssess = function (account) {
		// 保存评估的账号到sessionStorage
		data_sessionStorage = JSON.parse(sessionStorage.getItem('data_sessionStorage'));
		data_sessionStorage.assInfo.ass_olderInfo.account = account;
		sessionStorage.setItem('data_sessionStorage', JSON.stringify(data_sessionStorage));
		
		// 跳转页面到评估做题
		$location.path('/firstassess1');
		$scope.$apply();
	};
});